#!/usr/bin/env bash
# This script runs clippy with the most common configurations.
# Arguments given will be passed through to "cargo clippy"
# This runs in the Makefile environment via "make run"

set -euo pipefail

# Run from the Makefile environment
MAKEFILE_RUN=${MAKEFILE_RUN:-""}
if [[ -z $MAKEFILE_RUN ]] ; then
	COMMAND="$0 $*" exec make run
fi
SHELL_DEBUG=${SHELL_DEBUG:-""}
if [[ -n "$SHELL_DEBUG" ]] ; then
  set -x
fi

./scripts/clippy --all-targets

# for pkg in "components/cdc" "components/backup" "cmd" "tests"; do
# 	cd $pkg
# 	cargo clippy --all-targets --no-default-features \
# 		--features "${TIKV_ENABLE_FEATURES}" -- "${ALLOWED_CLIPPY_LINTS[@]}"
# 	cd - >/dev/null
# done
# for pkg in "fuzz"; do
# 	cd $pkg
# 	cargo clippy --all-targets -- "${ALLOWED_CLIPPY_LINTS[@]}"
# 	cd - >/dev/null
# done
